From: Rosen Penev Date: Wed, 21 May 2025 01:17:32 +0000 (-0700) Subject: ath79: iodata: extract calibration with nvmem X-Git-Url: http://git.openwrt.org/%22https:/collectd.org//%22/%22https:/collectd.org/%22?a=commitdiff_plain;h=5eef79a249017eafec422117412bc72a320edfe6;p=openwrt%2Fopenwrt.git ath79: iodata: extract calibration with nvmem Userspace handling is deprecated. Signed-off-by: Rosen Penev Link: https://github.com/openwrt/openwrt/pull/18873 Signed-off-by: Robert Marko --- diff --git a/target/linux/ath79/dts/ar1022_iodata_wn-ag300dgr.dts b/target/linux/ath79/dts/ar1022_iodata_wn-ag300dgr.dts index e1d5f2dac1..6eb072ef2f 100644 --- a/target/linux/ath79/dts/ar1022_iodata_wn-ag300dgr.dts +++ b/target/linux/ath79/dts/ar1022_iodata_wn-ag300dgr.dts @@ -159,6 +159,16 @@ label = "art"; reg = <0xff0000 0x010000>; read-only; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + cal_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; + }; }; }; }; @@ -207,5 +217,6 @@ &wmac { status = "okay"; - qca,no-eeprom; + nvmem-cells = <&cal_art_1000>; + nvmem-cell-names = "calibration"; }; diff --git a/target/linux/ath79/dts/qca9557_iodata_wn-ac-dgr.dtsi b/target/linux/ath79/dts/qca9557_iodata_wn-ac-dgr.dtsi index bdba469383..bc05ec559a 100644 --- a/target/linux/ath79/dts/qca9557_iodata_wn-ac-dgr.dtsi +++ b/target/linux/ath79/dts/qca9557_iodata_wn-ac-dgr.dtsi @@ -148,6 +148,10 @@ #address-cells = <1>; #size-cells = <1>; + cal_art_1000: calibration@1000 { + reg = <0x1000 0x440>; + }; + cal_art_5000: calibration@5000 { reg = <0x5000 0x844>; }; @@ -199,5 +203,6 @@ &wmac { status = "okay"; - qca,no-eeprom; + nvmem-cells = <&cal_art_1000>; + nvmem-cell-names = "calibration"; }; diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom index 89cb3df6f2..f912ad4150 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -45,10 +45,6 @@ case "$FIRMWARE" in caldata_extract "art" 0x1000 0x440 ath9k_patch_mac $(mtd_get_mac_ascii cfg1 RADIOADDR1) ;; - iodata,wn-ac1167dgr|\ - iodata,wn-ac1600dgr|\ - iodata,wn-ac1600dgr2|\ - iodata,wn-ag300dgr|\ sitecom,wlr-7100|\ sitecom,wlr-8100) caldata_extract "art" 0x1000 0x440 diff --git a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac index 9b5593b972..1774b9f8f2 100644 --- a/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac +++ b/target/linux/ath79/generic/base-files/etc/hotplug.d/ieee80211/10_fix_wifi_mac @@ -73,18 +73,23 @@ case "$board" in ;; iodata,wn-ac1167dgr|\ iodata,wn-ac1600dgr|\ - iodata,wn-ac1600dgr2|\ - sitecom,wlr-7100|\ - sitecom,wlr-8100) + iodata,wn-ac1600dgr2) # There is no eeprom data for 5 GHz wlan in "art" partition # which would allow to patch the macaddress [ "$PHYNBR" -eq 0 ] && \ macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" 1 > /sys${DEVPATH}/macaddress ;; + [ "$PHYNBR" -eq 1 ] && \ + macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" 0 > /sys${DEVPATH}/macaddress + ;; iodata,wn-ag300dgr) # There is no eeprom data for 5 GHz wlan in "art" partition # which would allow to patch the macaddress - [ "$PHYNBR" -eq 1 ] && \ + macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" $PHYNBR > /sys${DEVPATH}/macaddress + ;; + sitecom,wlr-7100|\ + sitecom,wlr-8100) + [ "$PHYNBR" -eq 0 ] && \ macaddr_add "$(mtd_get_mac_ascii u-boot-env ethaddr)" 1 > /sys${DEVPATH}/macaddress ;; nec,wf1200cr|\